﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TableQuery.aspx.cs" Inherits="Manage_System_TableQuery" %>

<%@ Import Namespace="KeRui.BLL" %>
<html>
<head>
    <!--#include file="../js/html_head.inc"-->
    <link rel="stylesheet" href="../Themes/<%=ManageHelper.GetTheme()%>/style.css" type="text/css" />
</head>
<body>

    <script type="text/javascript">
    function Check(tablename)
    {
        var err="";
        $.ajax({
            type:"POST",
            async:false,
            url:"?",
            data:"act=gettabledetails&tablename="+tablename,
            success:function(msg){
              
            }
        });
        return err;
    }
    </script>

    <div class="column">
        <div class="columntitle">
            数据库表结构查看器</div>
        <table width="100%" align="center" cellpadding="4" cellspacing="4">
            <tr>
                <td align="left">
                    <img id="ctl02_ctl00_imgHelp" tabindex="-1" src="../pic/icons/help.gif" alt="数据库包含的表及视图列表"
                        style="border-width: 0px;" />
                    <span>表及视图列表：</span>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <select size="10" name="TablesAndViewsListBox" onchange="GetTableStructure(this.value)"
                        id="TablesAndViewsListBox">
                        <%
                            KeRui.BLL.SQLQueryTable bllSQLQueryTable = new SQLQueryTable();
                            System.Data.DataTable dt = bllSQLQueryTable.GetTableList().Tables[0];
                            foreach (System.Data.DataRow row in dt.Rows)
                            {%>
                        <option value="<%=row["TableName"] %>">
                            <%=row["TableName"]%>
                        </option>
                        <%
                            }
                        %>
                    </select>
                </td>
            </tr>
            <tr style="background-position: center 50%; background-image: url(../pic/line.gif);
                background-repeat: repeat-x">
                <td colspan="3">
                    &nbsp;</td>
            </tr>
        </table>
        <table cellpadding="3" width="100%" align="center">
            <tr>
                <td align="center">
                    <a id="TableNameHyperLink" href="" style="font-weight: bold;">[SiteServer].[dbo].[au_Comment]</a></td>
            </tr>
            <tr>
                <td>
                    <table cellspacing="2" cellpadding="2" rules="all" align="center" border="0" id="MyDataGrid"
                        style="border-width: 0px; width: 100%;">
                        <tr class="summary-title" align="center" style="height: 25px;">
                            <td>
                            </td>
                            <td>
                                字段名</td>
                            <td>
                                数据类型</td>
                            <td>
                                数据长度</td>
                            <td>
                                数据精度</td>
                            <td>
                                小数位数</td>
                            <td>
                                属性</td>
                            <td>
                                默认值</td>
                            <td>
                                关系</td>
                            <td>
                                字段注释</td>
                        </tr>
                        <tr class="tdbg" onmouseover="this.className='tdbg-dark';" onmouseout="this.className='tdbg';"
                            style="height: 25px;">
                            <td align="center" style="width: 40px;">
                                1</td>
                            <td align="center">
                                ID</td>
                            <td align="center" style="width: 120px;">
                                Integer</td>
                            <td align="center" style="width: 120px;">
                                4</td>
                            <td align="center" style="width: 120px;">
                                10</td>
                            <td align="center" style="width: 120px;">
                                0</td>
                            <td align="center" style="width: 130px;">
                                Identity, Primary Key
                            </td>
                            <td align="center" style="width: 120px;">
                                &nbsp;</td>
                            <td align="center" style="width: 130px;">
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>
